/* enum */
import { ComponentNameEnum } from '@src/component/business/BizChatPanel/chat/model/enum'
/* scss */
import '@src/component/business/BizChatPanel/chat/components/prompt-tag/index.scss'
/* vue */
import { defineComponent } from 'vue'
/* util */
import { isFalsy } from '@src/util/type'

export type ChatAIPromptTagProps = {
  
}

export interface ChatAIPromptTagSetupState {
  
}

export enum ChatAIPromptTagEventEnum {
  Input = 'input',
  Click = 'click'
}

export default defineComponent({
  name: ComponentNameEnum.ChatAIPromptTag,
  emits: [
    ChatAIPromptTagEventEnum.Input,
    ChatAIPromptTagEventEnum.Click,
  ],
  props: {
    label: {
      type: String,
      default: ''
    },
    value: {
      type: String,
      default: ''
    },
    onClick: {
      type: Function
    }
  },
  setup(props: ChatAIPromptTagProps, { slots, emit }) {
    
  },
  computed: {
    
  },
  methods: {
    onInputHandler(value: string) {
      this.$emit(ChatAIPromptTagEventEnum.Input, value)
    },
    onClickHandler() {
      this.$emit(ChatAIPromptTagEventEnum.Click, this.value)
    }
  },
  render() {
    
    if (isFalsy(this.label)) {
      return
    }
    
    return (
      <div 
        class={ComponentNameEnum.ChatAIPromptTag}
        onClick={this.onClickHandler}
      >
        {this.label}
      </div>
    ) as any
  }
})
